<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE FlexibleInstances #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE FunctionalDependencies #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE MultiParamTypeClasses #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LANGUAGE UndecidableInstances #-}</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-comment">{- |
Module      :  Control.Monad.Error.Class
Copyright   :  (c) Michael Weber &lt;michael.weber@post.rwth-aachen.de&gt; 2001,
               (c) Jeff Newbern 2003-2006,
               (c) Andriy Palamarchuk 2006
               (c) Edward Kmett 2012
License     :  BSD-style (see the file LICENSE)

Maintainer  :  libraries@haskell.org
Stability   :  experimental
Portability :  non-portable (multi-parameter type classes)

[Computation type:] Computations which may fail or throw exceptions.

[Binding strategy:] Failure records information about the cause\/location
of the failure. Failure values bypass the bound function,
other values are used as inputs to the bound function.

[Useful for:] Building computations from sequences of functions that may fail
or using exception handling to structure error handling.

[Zero and plus:] Zero is represented by an empty error and the plus operation
executes its second argument if the first fails.

[Example type:] @'Either' 'String' a@

The Error monad (also called the Exception monad).
-}</span><span>
</span><span id="line-35"></span><span>
</span><span id="line-36"></span><span class="hs-comment">{-
  Rendered by Michael Weber &lt;mailto:michael.weber@post.rwth-aachen.de&gt;,
  inspired by the Haskell Monad Template Library from
    Andy Gill (&lt;http://web.cecs.pdx.edu/~andy/&gt;)
-}</span><span>
</span><span id="line-41"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Control.Monad.Error.Class</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-42"></span><span>    </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#Error"><span class="hs-identifier">Error</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>    </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier">MonadError</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>    </span><span class="annot"><a href="Control.Monad.Error.Class.html#liftEither"><span class="hs-identifier">liftEither</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-45"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#"><span class="hs-identifier">Control.Monad.Trans.Except</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#Except"><span class="hs-identifier">Except</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier">ExceptT</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#"><span class="hs-identifier">Control.Monad.Trans.Error</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#Error"><span class="hs-identifier">Error</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier">ErrorT</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#"><span class="hs-identifier">Control.Monad.Trans.Except</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">ExceptT</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#throwE"><span class="hs-identifier">throwE</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#catchE"><span class="hs-identifier">catchE</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#"><span class="hs-identifier">Control.Monad.Trans.Error</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">ErrorT</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#throwError"><span class="hs-identifier">throwError</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#catchError"><span class="hs-identifier">catchError</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Identity.html#"><span class="hs-identifier">Control.Monad.Trans.Identity</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Identity</span></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.List.html#"><span class="hs-identifier">Control.Monad.Trans.List</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">List</span></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#"><span class="hs-identifier">Control.Monad.Trans.Maybe</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Maybe</span></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#"><span class="hs-identifier">Control.Monad.Trans.Reader</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Reader</span></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#"><span class="hs-identifier">Control.Monad.Trans.RWS.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LazyRWS</span></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#"><span class="hs-identifier">Control.Monad.Trans.RWS.Strict</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">StrictRWS</span></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#"><span class="hs-identifier">Control.Monad.Trans.State.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LazyState</span></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#"><span class="hs-identifier">Control.Monad.Trans.State.Strict</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">StrictState</span></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#"><span class="hs-identifier">Control.Monad.Trans.Writer.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LazyWriter</span></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#"><span class="hs-identifier">Control.Monad.Trans.Writer.Strict</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">StrictWriter</span></span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Class.html#"><span class="hs-identifier">Control.Monad.Trans.Class</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier">lift</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Exception.html#"><span class="hs-identifier">Control.Exception</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOException"><span class="hs-identifier">IOException</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#catch"><span class="hs-identifier">catch</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#ioError"><span class="hs-identifier">ioError</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span class="hs-cpp">

#if defined(__GLASGOW_HASKELL__) &amp;&amp; __GLASGOW_HASKELL__ &lt; 707
</span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Control.Monad.Instances</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Monoid.html#"><span class="hs-identifier">Data.Monoid</span></a></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier">Either</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier">Maybe</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#either"><span class="hs-identifier">either</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#."><span class="hs-operator">(.)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier">IO</span></span><span class="hs-special">)</span><span>
</span><span id="line-72"></span><span>
</span><span id="line-73"></span><span class="hs-comment">{- |
The strategy of combining computations that can throw exceptions
by bypassing bound functions
from the point an exception is thrown to the point that it is handled.

Is parameterized over the type of error information and
the monad type constructor.
It is common to use @'Either' String@ as the monad type constructor
for an error monad in which error descriptions take the form of strings.
In that case and many other common cases the resulting monad is already defined
as an instance of the 'MonadError' class.
You can also define your own error type and\/or use a monad type constructor
other than @'Either' 'String'@ or @'Either' 'IOError'@.
In these cases you will have to explicitly define instances of the 'MonadError'
class.
(If you are using the deprecated &quot;Control.Monad.Error&quot; or
&quot;Control.Monad.Trans.Error&quot;, you may also have to define an 'Error' instance.)
-}</span><span>
</span><span id="line-91"></span><span class="hs-keyword">class</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039598"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="MonadError"><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-var">MonadError</span></a></span></span><span> </span><span id="local-6989586621679039599"><span class="annot"><a href="#local-6989586621679039599"><span class="hs-identifier hs-type">e</span></a></span></span><span> </span><span id="local-6989586621679039598"><span class="annot"><a href="#local-6989586621679039598"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="#local-6989586621679039598"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679039599"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-92"></span><span>    </span><span class="hs-comment">-- | Is used within a monadic computation to begin exception processing.</span><span>
</span><span id="line-93"></span><span>    </span><span id="local-6989586621679039587"><span id="throwError"><span class="annot"><a href="Control.Monad.Error.Class.html#throwError"><span class="hs-identifier hs-type">throwError</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679039599"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679039598"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039587"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span>    </span><span class="hs-comment">{- |
    A handler function to handle previous errors and return to normal execution.
    A common idiom is:

    &gt; do { action1; action2; action3 } `catchError` handler

    where the @action@ functions can call 'throwError'.
    Note that @handler@ and the do-block must have the same return type.
    -}</span><span>
</span><span id="line-104"></span><span>    </span><span id="local-6989586621679039583"><span id="catchError"><span class="annot"><a href="Control.Monad.Error.Class.html#catchError"><span class="hs-identifier hs-type">catchError</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679039598"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039583"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679039599"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679039598"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039583"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679039598"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039583"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 707
</span><span>    </span><span class="hs-pragma">{-# MINIMAL</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#throwError"><span class="hs-pragma hs-type">throwError</span></a></span><span class="hs-pragma">,</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#catchError"><span class="hs-pragma hs-type">catchError</span></a></span><span> </span><span class="hs-pragma">#-}</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-109"></span><span class="hs-comment">{- |
Lifts an @'Either' e@ into any @'MonadError' e@.

&gt; do { val &lt;- liftEither =&lt;&lt; action1; action2 }

where @action1@ returns an 'Either' to represent errors.

@since 2.2.2
-}</span><span>
</span><span id="line-118"></span><span id="local-6989586621679039594"><span id="local-6989586621679039595"><span id="local-6989586621679039596"><span class="annot"><a href="Control.Monad.Error.Class.html#liftEither"><span class="hs-identifier hs-type">liftEither</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039596"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039595"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039596"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039594"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679039595"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039594"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-119"></span><span id="liftEither"><span class="annot"><span class="annottext">liftEither :: forall e (m :: * -&gt; *) a. MonadError e m =&gt; Either e a -&gt; m a
</span><a href="Control.Monad.Error.Class.html#liftEither"><span class="hs-identifier hs-var hs-var">liftEither</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(e -&gt; m a) -&gt; (a -&gt; m a) -&gt; Either e a -&gt; m a
forall a c b. (a -&gt; c) -&gt; (b -&gt; c) -&gt; Either a b -&gt; c
</span><a href="../../base/src/Data.Either.html#either"><span class="hs-identifier hs-var">either</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall e (m :: * -&gt; *) a. MonadError e m =&gt; e -&gt; m a
</span><a href="Control.Monad.Error.Class.html#throwError"><span class="hs-identifier hs-var">throwError</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; m a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span>
</span><span id="line-120"></span><span>
</span><span id="line-121"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOException"><span class="hs-identifier hs-type">IOException</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-122"></span><span>    </span><span id="local-6989586621679039341"><span class="annot"><span class="annottext">throwError :: forall a. IOException -&gt; IO a
</span><a href="#local-6989586621679039341"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; IO a
forall a. IOException -&gt; IO a
</span><a href="../../base/src/GHC.IO.Exception.html#ioError"><span class="hs-identifier hs-var">ioError</span></a></span><span>
</span><span id="line-123"></span><span>    </span><span id="local-6989586621679039338"><span class="annot"><span class="annottext">catchError :: forall a. IO a -&gt; (IOException -&gt; IO a) -&gt; IO a
</span><a href="#local-6989586621679039338"><span class="hs-identifier hs-var hs-var hs-var hs-var">catchError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; (IOException -&gt; IO a) -&gt; IO a
forall e a. Exception e =&gt; IO a -&gt; (e -&gt; IO a) -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#catch"><span class="hs-identifier hs-var">catch</span></a></span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span class="hs-comment">{- | @since 2.2.2 -}</span><span>
</span><span id="line-126"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-127"></span><span>    </span><span id="local-6989586621679039331"><span class="annot"><span class="annottext">throwError :: forall a. () -&gt; Maybe a
</span><a href="#local-6989586621679039331"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwError</span></a></span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe a
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-128"></span><span>    </span><span id="local-6989586621679039330"><span class="annot"><span class="annottext">catchError :: forall a. Maybe a -&gt; (() -&gt; Maybe a) -&gt; Maybe a
</span><a href="#local-6989586621679039330"><span class="hs-identifier hs-var hs-var hs-var hs-var">catchError</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span id="local-6989586621679039329"><span class="annot"><span class="annottext">() -&gt; Maybe a
</span><a href="#local-6989586621679039329"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; Maybe a
</span><a href="#local-6989586621679039329"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-129"></span><span>    </span><span class="annot"><a href="Control.Monad.Error.Class.html#catchError"><span class="hs-identifier hs-var">catchError</span></a></span><span> </span><span id="local-6989586621679039328"><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679039328"><span class="hs-identifier hs-var">x</span></a></span></span><span>       </span><span class="annot"><span class="annottext">() -&gt; Maybe a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679039328"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-130"></span><span>
</span><span id="line-131"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-132"></span><span class="hs-comment">-- Our parameterizable error monad</span><span>
</span><span id="line-133"></span><span>
</span><span id="line-134"></span><span id="local-6989586621679039573"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039573"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039573"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-135"></span><span>    </span><span id="local-6989586621679039321"><span class="annot"><span class="annottext">throwError :: forall a. e -&gt; Either e a
</span><a href="#local-6989586621679039321"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwError</span></a></span></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">e -&gt; Either e a
forall e a. e -&gt; Either e a
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span>
</span><span id="line-136"></span><span>    </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span>  </span><span id="local-6989586621679039320"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679039320"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679039319"><span class="annot"><span class="annottext">catchError :: forall a. Either e a -&gt; (e -&gt; Either e a) -&gt; Either e a
</span><a href="#local-6989586621679039319"><span class="hs-operator hs-var hs-var hs-var hs-var">`catchError`</span></a></span></span><span> </span><span id="local-6989586621679039318"><span class="annot"><span class="annottext">e -&gt; Either e a
</span><a href="#local-6989586621679039318"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">e -&gt; Either e a
</span><a href="#local-6989586621679039318"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679039320"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-137"></span><span>    </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679039317"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679039317"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#catchError"><span class="hs-operator hs-var">`catchError`</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; Either e a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Either e a
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679039317"><span class="hs-identifier hs-var">r</span></a></span></span><span>
</span><span id="line-138"></span><span>
</span><span id="line-139"></span><span id="local-6989586621679039563"><span id="local-6989586621679039564"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039564"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039563"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039563"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039563"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039564"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-140"></span><span>    </span><span id="local-6989586621679039307"><span class="annot"><span class="annottext">throwError :: forall a. e -&gt; ErrorT e m a
</span><a href="#local-6989586621679039307"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">e -&gt; ErrorT e m a
forall (m :: * -&gt; *) e a. Monad m =&gt; e -&gt; ErrorT e m a
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#throwError"><span class="hs-identifier hs-var">ErrorT.throwError</span></a></span><span>
</span><span id="line-141"></span><span>    </span><span id="local-6989586621679039305"><span class="annot"><span class="annottext">catchError :: forall a. ErrorT e m a -&gt; (e -&gt; ErrorT e m a) -&gt; ErrorT e m a
</span><a href="#local-6989586621679039305"><span class="hs-identifier hs-var hs-var hs-var hs-var">catchError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ErrorT e m a -&gt; (e -&gt; ErrorT e m a) -&gt; ErrorT e m a
forall (m :: * -&gt; *) e a.
Monad m =&gt;
ErrorT e m a -&gt; (e -&gt; ErrorT e m a) -&gt; ErrorT e m a
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#catchError"><span class="hs-identifier hs-var">ErrorT.catchError</span></a></span></span></span><span>
</span><span id="line-142"></span><span>
</span><span id="line-143"></span><span class="hs-comment">{- | @since 2.2 -}</span><span>
</span><span id="line-144"></span><span id="local-6989586621679039550"><span id="local-6989586621679039551"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039551"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039550"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-type">ExceptT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039550"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039551"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-145"></span><span>    </span><span id="local-6989586621679039296"><span class="annot"><span class="annottext">throwError :: forall a. e -&gt; ExceptT e m a
</span><a href="#local-6989586621679039296"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">e -&gt; ExceptT e m a
forall (m :: * -&gt; *) e a. Monad m =&gt; e -&gt; ExceptT e m a
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#throwE"><span class="hs-identifier hs-var">ExceptT.throwE</span></a></span><span>
</span><span id="line-146"></span><span>    </span><span id="local-6989586621679039294"><span class="annot"><span class="annottext">catchError :: forall a. ExceptT e m a -&gt; (e -&gt; ExceptT e m a) -&gt; ExceptT e m a
</span><a href="#local-6989586621679039294"><span class="hs-identifier hs-var hs-var hs-var hs-var">catchError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ExceptT e m a -&gt; (e -&gt; ExceptT e m a) -&gt; ExceptT e m a
forall (m :: * -&gt; *) e a e'.
Monad m =&gt;
ExceptT e m a -&gt; (e -&gt; ExceptT e' m a) -&gt; ExceptT e' m a
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#catchE"><span class="hs-identifier hs-var">ExceptT.catchE</span></a></span></span></span><span>
</span><span id="line-147"></span><span>
</span><span id="line-148"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-149"></span><span class="hs-comment">-- Instances for other mtl transformers</span><span>
</span><span id="line-150"></span><span class="hs-comment">--</span><span>
</span><span id="line-151"></span><span class="hs-comment">-- All of these instances need UndecidableInstances,</span><span>
</span><span id="line-152"></span><span class="hs-comment">-- because they do not satisfy the coverage condition.</span><span>
</span><span id="line-153"></span><span>
</span><span id="line-154"></span><span id="local-6989586621679039535"><span id="local-6989586621679039536"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039536"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039535"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039536"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Identity.html#IdentityT"><span class="hs-identifier hs-type">IdentityT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039535"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-155"></span><span>    </span><span id="local-6989586621679039281"><span class="annot"><span class="annottext">throwError :: forall a. e -&gt; IdentityT m a
</span><a href="#local-6989586621679039281"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; IdentityT m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; IdentityT m a) -&gt; (e -&gt; m a) -&gt; e -&gt; IdentityT m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall e (m :: * -&gt; *) a. MonadError e m =&gt; e -&gt; m a
</span><a href="Control.Monad.Error.Class.html#throwError"><span class="hs-identifier hs-var">throwError</span></a></span><span>
</span><span id="line-156"></span><span>    </span><span id="local-6989586621679039279"><span class="annot"><span class="annottext">catchError :: forall a. IdentityT m a -&gt; (e -&gt; IdentityT m a) -&gt; IdentityT m a
</span><a href="#local-6989586621679039279"><span class="hs-identifier hs-var hs-var hs-var hs-var">catchError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Catch e m a -&gt; Catch e (IdentityT m) a
forall {k} e (m :: k -&gt; *) (a :: k).
Catch e m a -&gt; Catch e (IdentityT m) a
</span><a href="../../transformers/src/Control.Monad.Trans.Identity.html#liftCatch"><span class="hs-identifier hs-var">Identity.liftCatch</span></a></span><span> </span><span class="annot"><span class="annottext">Catch e m a
forall e (m :: * -&gt; *) a.
MonadError e m =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Error.Class.html#catchError"><span class="hs-identifier hs-var">catchError</span></a></span></span></span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span id="local-6989586621679039515"><span id="local-6989586621679039516"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039516"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039515"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039516"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.List.html#ListT"><span class="hs-identifier hs-type">ListT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039515"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-159"></span><span>    </span><span id="local-6989586621679039265"><span class="annot"><span class="annottext">throwError :: forall a. e -&gt; ListT m a
</span><a href="#local-6989586621679039265"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; ListT m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; ListT m a) -&gt; (e -&gt; m a) -&gt; e -&gt; ListT m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall e (m :: * -&gt; *) a. MonadError e m =&gt; e -&gt; m a
</span><a href="Control.Monad.Error.Class.html#throwError"><span class="hs-identifier hs-var">throwError</span></a></span><span>
</span><span id="line-160"></span><span>    </span><span id="local-6989586621679039263"><span class="annot"><span class="annottext">catchError :: forall a. ListT m a -&gt; (e -&gt; ListT m a) -&gt; ListT m a
</span><a href="#local-6989586621679039263"><span class="hs-identifier hs-var hs-var hs-var hs-var">catchError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Catch e m [a] -&gt; Catch e (ListT m) a
forall e (m :: * -&gt; *) a. Catch e m [a] -&gt; Catch e (ListT m) a
</span><a href="../../transformers/src/Control.Monad.Trans.List.html#liftCatch"><span class="hs-identifier hs-var">List.liftCatch</span></a></span><span> </span><span class="annot"><span class="annottext">Catch e m [a]
forall e (m :: * -&gt; *) a.
MonadError e m =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Error.Class.html#catchError"><span class="hs-identifier hs-var">catchError</span></a></span></span></span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span id="local-6989586621679039504"><span id="local-6989586621679039505"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039505"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039504"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039505"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039504"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-163"></span><span>    </span><span id="local-6989586621679039249"><span class="annot"><span class="annottext">throwError :: forall a. e -&gt; MaybeT m a
</span><a href="#local-6989586621679039249"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; MaybeT m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; MaybeT m a) -&gt; (e -&gt; m a) -&gt; e -&gt; MaybeT m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall e (m :: * -&gt; *) a. MonadError e m =&gt; e -&gt; m a
</span><a href="Control.Monad.Error.Class.html#throwError"><span class="hs-identifier hs-var">throwError</span></a></span><span>
</span><span id="line-164"></span><span>    </span><span id="local-6989586621679039247"><span class="annot"><span class="annottext">catchError :: forall a. MaybeT m a -&gt; (e -&gt; MaybeT m a) -&gt; MaybeT m a
</span><a href="#local-6989586621679039247"><span class="hs-identifier hs-var hs-var hs-var hs-var">catchError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Catch e m (Maybe a) -&gt; Catch e (MaybeT m) a
forall e (m :: * -&gt; *) a.
Catch e m (Maybe a) -&gt; Catch e (MaybeT m) a
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#liftCatch"><span class="hs-identifier hs-var">Maybe.liftCatch</span></a></span><span> </span><span class="annot"><span class="annottext">Catch e m (Maybe a)
forall e (m :: * -&gt; *) a.
MonadError e m =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Error.Class.html#catchError"><span class="hs-identifier hs-var">catchError</span></a></span></span></span><span>
</span><span id="line-165"></span><span>
</span><span id="line-166"></span><span id="local-6989586621679039490"><span id="local-6989586621679039491"><span id="local-6989586621679039492"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039492"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039491"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039492"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-type">ReaderT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039490"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039491"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-167"></span><span>    </span><span id="local-6989586621679039233"><span class="annot"><span class="annottext">throwError :: forall a. e -&gt; ReaderT r m a
</span><a href="#local-6989586621679039233"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; ReaderT r m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; ReaderT r m a) -&gt; (e -&gt; m a) -&gt; e -&gt; ReaderT r m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall e (m :: * -&gt; *) a. MonadError e m =&gt; e -&gt; m a
</span><a href="Control.Monad.Error.Class.html#throwError"><span class="hs-identifier hs-var">throwError</span></a></span><span>
</span><span id="line-168"></span><span>    </span><span id="local-6989586621679039231"><span class="annot"><span class="annottext">catchError :: forall a. ReaderT r m a -&gt; (e -&gt; ReaderT r m a) -&gt; ReaderT r m a
</span><a href="#local-6989586621679039231"><span class="hs-identifier hs-var hs-var hs-var hs-var">catchError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Catch e m a -&gt; Catch e (ReaderT r m) a
forall e (m :: * -&gt; *) a r. Catch e m a -&gt; Catch e (ReaderT r m) a
</span><a href="../../transformers/src/Control.Monad.Trans.Reader.html#liftCatch"><span class="hs-identifier hs-var">Reader.liftCatch</span></a></span><span> </span><span class="annot"><span class="annottext">Catch e m a
forall e (m :: * -&gt; *) a.
MonadError e m =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Error.Class.html#catchError"><span class="hs-identifier hs-var">catchError</span></a></span></span></span></span><span>
</span><span id="line-169"></span><span>
</span><span id="line-170"></span><span id="local-6989586621679039468"><span id="local-6989586621679039469"><span id="local-6989586621679039470"><span id="local-6989586621679039471"><span id="local-6989586621679039472"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039472"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039471"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039470"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039471"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">LazyRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039469"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039472"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039468"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039470"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-171"></span><span>    </span><span id="local-6989586621679039216"><span class="annot"><span class="annottext">throwError :: forall a. e -&gt; RWST r w s m a
</span><a href="#local-6989586621679039216"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; RWST r w s m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; RWST r w s m a) -&gt; (e -&gt; m a) -&gt; e -&gt; RWST r w s m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall e (m :: * -&gt; *) a. MonadError e m =&gt; e -&gt; m a
</span><a href="Control.Monad.Error.Class.html#throwError"><span class="hs-identifier hs-var">throwError</span></a></span><span>
</span><span id="line-172"></span><span>    </span><span id="local-6989586621679039214"><span class="annot"><span class="annottext">catchError :: forall a. RWST r w s m a -&gt; (e -&gt; RWST r w s m a) -&gt; RWST r w s m a
</span><a href="#local-6989586621679039214"><span class="hs-identifier hs-var hs-var hs-var hs-var">catchError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Catch e m (a, s, w) -&gt; Catch e (RWST r w s m) a
forall e (m :: * -&gt; *) a s w r.
Catch e m (a, s, w) -&gt; Catch e (RWST r w s m) a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#liftCatch"><span class="hs-identifier hs-var">LazyRWS.liftCatch</span></a></span><span> </span><span class="annot"><span class="annottext">Catch e m (a, s, w)
forall e (m :: * -&gt; *) a.
MonadError e m =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Error.Class.html#catchError"><span class="hs-identifier hs-var">catchError</span></a></span></span></span></span></span></span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span id="local-6989586621679039442"><span id="local-6989586621679039443"><span id="local-6989586621679039444"><span id="local-6989586621679039445"><span id="local-6989586621679039446"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039446"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039445"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039444"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039445"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-type">StrictRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039443"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039446"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039442"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039444"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-175"></span><span>    </span><span id="local-6989586621679039199"><span class="annot"><span class="annottext">throwError :: forall a. e -&gt; RWST r w s m a
</span><a href="#local-6989586621679039199"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; RWST r w s m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; RWST r w s m a) -&gt; (e -&gt; m a) -&gt; e -&gt; RWST r w s m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall e (m :: * -&gt; *) a. MonadError e m =&gt; e -&gt; m a
</span><a href="Control.Monad.Error.Class.html#throwError"><span class="hs-identifier hs-var">throwError</span></a></span><span>
</span><span id="line-176"></span><span>    </span><span id="local-6989586621679039197"><span class="annot"><span class="annottext">catchError :: forall a. RWST r w s m a -&gt; (e -&gt; RWST r w s m a) -&gt; RWST r w s m a
</span><a href="#local-6989586621679039197"><span class="hs-identifier hs-var hs-var hs-var hs-var">catchError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Catch e m (a, s, w) -&gt; Catch e (RWST r w s m) a
forall e (m :: * -&gt; *) a s w r.
Catch e m (a, s, w) -&gt; Catch e (RWST r w s m) a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#liftCatch"><span class="hs-identifier hs-var">StrictRWS.liftCatch</span></a></span><span> </span><span class="annot"><span class="annottext">Catch e m (a, s, w)
forall e (m :: * -&gt; *) a.
MonadError e m =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Error.Class.html#catchError"><span class="hs-identifier hs-var">catchError</span></a></span></span></span></span></span></span><span>
</span><span id="line-177"></span><span>
</span><span id="line-178"></span><span id="local-6989586621679039422"><span id="local-6989586621679039423"><span id="local-6989586621679039424"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039424"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039423"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039424"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-type">LazyState.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039422"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039423"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-179"></span><span>    </span><span id="local-6989586621679039183"><span class="annot"><span class="annottext">throwError :: forall a. e -&gt; StateT s m a
</span><a href="#local-6989586621679039183"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; StateT s m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; StateT s m a) -&gt; (e -&gt; m a) -&gt; e -&gt; StateT s m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall e (m :: * -&gt; *) a. MonadError e m =&gt; e -&gt; m a
</span><a href="Control.Monad.Error.Class.html#throwError"><span class="hs-identifier hs-var">throwError</span></a></span><span>
</span><span id="line-180"></span><span>    </span><span id="local-6989586621679039181"><span class="annot"><span class="annottext">catchError :: forall a. StateT s m a -&gt; (e -&gt; StateT s m a) -&gt; StateT s m a
</span><a href="#local-6989586621679039181"><span class="hs-identifier hs-var hs-var hs-var hs-var">catchError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Catch e m (a, s) -&gt; Catch e (StateT s m) a
forall e (m :: * -&gt; *) a s.
Catch e m (a, s) -&gt; Catch e (StateT s m) a
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#liftCatch"><span class="hs-identifier hs-var">LazyState.liftCatch</span></a></span><span> </span><span class="annot"><span class="annottext">Catch e m (a, s)
forall e (m :: * -&gt; *) a.
MonadError e m =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Error.Class.html#catchError"><span class="hs-identifier hs-var">catchError</span></a></span></span></span></span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span id="local-6989586621679039406"><span id="local-6989586621679039407"><span id="local-6989586621679039408"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039408"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039407"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039408"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-type">StrictState.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039406"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039407"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-183"></span><span>    </span><span id="local-6989586621679039167"><span class="annot"><span class="annottext">throwError :: forall a. e -&gt; StateT s m a
</span><a href="#local-6989586621679039167"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; StateT s m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; StateT s m a) -&gt; (e -&gt; m a) -&gt; e -&gt; StateT s m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall e (m :: * -&gt; *) a. MonadError e m =&gt; e -&gt; m a
</span><a href="Control.Monad.Error.Class.html#throwError"><span class="hs-identifier hs-var">throwError</span></a></span><span>
</span><span id="line-184"></span><span>    </span><span id="local-6989586621679039165"><span class="annot"><span class="annottext">catchError :: forall a. StateT s m a -&gt; (e -&gt; StateT s m a) -&gt; StateT s m a
</span><a href="#local-6989586621679039165"><span class="hs-identifier hs-var hs-var hs-var hs-var">catchError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Catch e m (a, s) -&gt; Catch e (StateT s m) a
forall e (m :: * -&gt; *) a s.
Catch e m (a, s) -&gt; Catch e (StateT s m) a
</span><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#liftCatch"><span class="hs-identifier hs-var">StrictState.liftCatch</span></a></span><span> </span><span class="annot"><span class="annottext">Catch e m (a, s)
forall e (m :: * -&gt; *) a.
MonadError e m =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Error.Class.html#catchError"><span class="hs-identifier hs-var">catchError</span></a></span></span></span></span><span>
</span><span id="line-185"></span><span>
</span><span id="line-186"></span><span id="local-6989586621679039390"><span id="local-6989586621679039391"><span id="local-6989586621679039392"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039392"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039391"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039390"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039391"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#WriterT"><span class="hs-identifier hs-type">LazyWriter.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039392"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039390"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-187"></span><span>    </span><span id="local-6989586621679039150"><span class="annot"><span class="annottext">throwError :: forall a. e -&gt; WriterT w m a
</span><a href="#local-6989586621679039150"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; WriterT w m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; WriterT w m a) -&gt; (e -&gt; m a) -&gt; e -&gt; WriterT w m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall e (m :: * -&gt; *) a. MonadError e m =&gt; e -&gt; m a
</span><a href="Control.Monad.Error.Class.html#throwError"><span class="hs-identifier hs-var">throwError</span></a></span><span>
</span><span id="line-188"></span><span>    </span><span id="local-6989586621679039148"><span class="annot"><span class="annottext">catchError :: forall a. WriterT w m a -&gt; (e -&gt; WriterT w m a) -&gt; WriterT w m a
</span><a href="#local-6989586621679039148"><span class="hs-identifier hs-var hs-var hs-var hs-var">catchError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Catch e m (a, w) -&gt; Catch e (WriterT w m) a
forall e (m :: * -&gt; *) a w.
Catch e m (a, w) -&gt; Catch e (WriterT w m) a
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#liftCatch"><span class="hs-identifier hs-var">LazyWriter.liftCatch</span></a></span><span> </span><span class="annot"><span class="annottext">Catch e m (a, w)
forall e (m :: * -&gt; *) a.
MonadError e m =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Error.Class.html#catchError"><span class="hs-identifier hs-var">catchError</span></a></span></span></span></span><span>
</span><span id="line-189"></span><span>
</span><span id="line-190"></span><span id="local-6989586621679039374"><span id="local-6989586621679039375"><span id="local-6989586621679039376"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039376"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039375"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039374"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Error.Class.html#MonadError"><span class="hs-identifier hs-type">MonadError</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039375"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#WriterT"><span class="hs-identifier hs-type">StrictWriter.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039376"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679039374"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-191"></span><span>    </span><span id="local-6989586621679039133"><span class="annot"><span class="annottext">throwError :: forall a. e -&gt; WriterT w m a
</span><a href="#local-6989586621679039133"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; WriterT w m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; WriterT w m a) -&gt; (e -&gt; m a) -&gt; e -&gt; WriterT w m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall e (m :: * -&gt; *) a. MonadError e m =&gt; e -&gt; m a
</span><a href="Control.Monad.Error.Class.html#throwError"><span class="hs-identifier hs-var">throwError</span></a></span><span>
</span><span id="line-192"></span><span>    </span><span id="local-6989586621679039131"><span class="annot"><span class="annottext">catchError :: forall a. WriterT w m a -&gt; (e -&gt; WriterT w m a) -&gt; WriterT w m a
</span><a href="#local-6989586621679039131"><span class="hs-identifier hs-var hs-var hs-var hs-var">catchError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Catch e m (a, w) -&gt; Catch e (WriterT w m) a
forall e (m :: * -&gt; *) a w.
Catch e m (a, w) -&gt; Catch e (WriterT w m) a
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#liftCatch"><span class="hs-identifier hs-var">StrictWriter.liftCatch</span></a></span><span> </span><span class="annot"><span class="annottext">Catch e m (a, w)
forall e (m :: * -&gt; *) a.
MonadError e m =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Error.Class.html#catchError"><span class="hs-identifier hs-var">catchError</span></a></span></span></span></span><span>
</span><span id="line-193"></span></pre></body></html>